

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.File;
import java.io.IOException;
import java.util.Random;
import org.apache.log4j.Logger;
import org.apache.log4j.Level;
import org.apache.log4j.Appender;
import org.apache.log4j.FileAppender;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.BasicConfigurator;

/**
 *
 * @author Paolo
 */
public class Tests {

    static Logger logger = Logger.getRootLogger();

    public static void main(String[] args) throws IOException {
//        BasicConfigurator.configure();
//
//        /* Cria um novo FileAppender baseado no layout padrão,
//         * pré-definido na constante TTCC_CONVERSION_PATTERN
//         * da classe PatternLayout. */
//        Appender fileAppender = new FileAppender(
//                new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN), "myLogFile.log");
//
//        logger.addAppender(fileAppender);
//        int i=0;
//        while(i<5){
//            try {
//                throw new Exception("Loga esse no arquivo, Log4J! "+i);
//            } catch (Exception e) {
//                logger.error("Oops, deu erro: " + e.getMessage());
//            }
//            i++;
//        }

//        String VirtualBoxXmlPath = System.getProperty("user.home") + File.separator + ".VirtualBox"+File.separator+"VirtualBox.xml";
//
//        File VirtualBoxXmlFile = new File(VirtualBoxXmlPath);
//
//        File newFile = new File(VirtualBoxXmlFile.getAbsolutePath()+"_backup");
//        VirtualBoxXmlFile.renameTo(newFile);
//
//        System.out.println(newFile.getName());
//        System.out.println(newFile.getAbsolutePath());
//
//        System.out.println("-------------------------------------------------");
//
//        newFile.renameTo(new File(newFile.getAbsolutePath().replace("_backup", "")));
//
//        System.out.println(VirtualBoxXmlFile.getName());
//        System.out.println(VirtualBoxXmlFile.getAbsolutePath());


        System.out.println();


    }


    

}


